package com.ck.company.service.impl;

import com.ck.company.service.CpScreenCanvasMappingService;
import com.ck.dao.ScreenCanvasMappingMapper;
import com.ck.model.common.ScreenCanvasMapping;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 屏幕分辨率画布映射
 *
 * @author linqiang
 * @version v1.0
 * @date 2018-09-14 11:02
 */
@Service("cpScreenCanvasMappingService")
public class CpScreenCanvasMappingServiceImpl implements CpScreenCanvasMappingService {

    @Autowired
    private ScreenCanvasMappingMapper screenCanvasMappingMapper;

    @Transactional(rollbackFor = Exception.class)
    @Override
    public int deleteByPrimaryKey(Long screenCanvasMappingId) {
        return screenCanvasMappingMapper.deleteByPrimaryKey(screenCanvasMappingId);
    }

    @Transactional(rollbackFor = Exception.class)
    @Override
    public int insert(ScreenCanvasMapping record) {
        return screenCanvasMappingMapper.insert(record);
    }

    @Override
    public ScreenCanvasMapping selectByScreen(Integer screenWidth, Integer screenHeight) {
        return screenCanvasMappingMapper.selectByScreen(screenWidth, screenHeight);
    }

    @Override
    public List<ScreenCanvasMapping> list() {
        return screenCanvasMappingMapper.list();
    }
}
